package example.oopcarfactory;

/**
 * @description: 通过继承和工厂，来创建对象
 * @author Administrator
 * @date 2022/2/5 20:33
 * @version 1.0
 */
public class Customer {
    
    public static void main(String[] args) {
        System.out.println("顾客要购买BMW:");
        Car bmw = CarFactory.getCar("BMW");
        System.out.println("提取汽车：" + bmw.getInfo());
        System.out.println("顾客要购买Benz:");
        Car benz = CarFactory.getCar("Benz");
        System.out.println("提取汽车：" + benz.getInfo());
    }
}
